<!DOCTYPE html>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>审核列表页面</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link rel="stylesheet" type="text/css" href="${contextPath}/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="${contextPath}/css/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" href="${contextPath}/css/public.css">
<link rel="stylesheet" type="text/css" href="${contextPath}/css/jquery-ui.theme.min.css">
<link rel="stylesheet" type="text/css" href="${contextPath}/css/jquery-ui.min.css">
<script type="text/javascript" src="${contextPath}/js/jquery.min.js"></script>
<script type="text/javascript" src="${contextPath}/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${contextPath}/js/common.js"></script>
<script type="text/javascript" src="${contextPath}/js/jquery.ui.core.js"></script>
<script type="text/javascript" src="${contextPath}/js/jquery.ui.datepicker-ch.js"></script>
<script type="text/javascript" src="${contextPath}/js/jquery.ui.datepicker.js"></script>
<style type="text/css">
	.input-group-addon,.form-control{padding:6px;}
	.ui-datepicker .ui-datepicker-title select{color:#1c94c4}
	#articleTop-tbody .titleTd, #articleList-tbody .titleTd{
		text-align: left;
	}
	#articleTop-tbody .titleTd a, #articleList-tbody .titleTd a{
		margin-left: 15px;
	}
</style>
</head>
<body>
	<jsp:include page="../head.jsp" />
	<div class="container">
		<ul class="nav nav-tabs" role="tablist">
			<li class="active"><a href="#inspectList" role="tab" data-toggle="tab">审核列表</a></li>
			<!-- <li><a href="#inspectByDayList" role="tab" data-toggle="tab">巡审列表</a></li> -->
			<li><a href="#markTimeList" role="tab" data-toggle="tab">标注时间列表</a></li>
			<li><a href="#unqualifiedSendbackList" role="tab" data-toggle="tab">不合格退回列表</a></li>
			<li><a href="#recycledBySystemList" role="tab" data-toggle="tab">被回收任务信息列表</a></li>
			<li><a href="#modifyTimeOutList" role="tab" data-toggle="tab">超时被回收列表</a></li>
			<li ><a href="#articleList" role="tab" data-toggle="tab">交流区</a></li>
		</ul>
		<div class="tab-content">
		<!-- ***********************************************审核列表*************************************************** -->
			<div class="tab-pane active" id="inspectList">
				<div class="panel panel-default">
					<div class="panel-body">
						<form class="form-inline" role="form">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon"> 用户名：</div>
									<input class="form-control" onkeydown="if(event.keyCode==13){return false;}" id="userNameCondition" type="text" placeholder="查询用户">
								</div>
							</div>
							<!-- <div class="form-group">
								<p class="form-control-static">标注时间段：</p>
							</div>
							<div class="form-group">
								<select class="form-control" id="timeMark">
									<option value="0">大于十分钟</option>
									<option value="1">小于十分钟</option>
								</select>
							</div> -->
							<div class="input-group">
								<div class="input-group-addon"> 发布批次：</div>
								<select class="form-control" id="packBatch">
									<option selected="selected" value="">全部</option>
									<c:forEach items="${batchNames }" var="batchName" >
										<option value="${batchName }">${batchName }</option>
									</c:forEach>
								</select>
							</div>
							<button type="button" id="searchBtn" class="btn btn-danger">查询</button>
							&nbsp;
							&nbsp;
							<div class="input-group">
								<div class="input-group-addon">审核数量：</div>
								<select class="form-control" id="inspectPercent_1">
								<!--<option value="10">10%</option>
									<option value="20">20%</option>
									<option value="30">30%</option>
									<option value="40">40%</option>
									<option value="50">50%</option> -->
									<option value="60">60%</option>
									<option value="70">70%</option>
									<option value="80">80%</option>
									<option value="90">90%</option>
									<option selected="selected" value="100">100%</option>
								</select>
							</div>
							&nbsp;
							&nbsp;
							<div class="input-group">
								<div class="input-group-addon">审核列表：</div>
								<select class="form-control" id="showInvalidTaskSelect">
									<option selected="selected" value="0">隐藏无效任务</option>
									<option value="1">显示无效任务</option>
								</select>
							</div>
						</form>
					</div>
					<table class="table table-striped table-bordered">
						<thead>
							<tr>
								<th width='10%'>序号</th>
								<th width='15%'>别名</th>
								<th width='15%'>姓名</th>
								<th width='20%' id="packBatchNumText">全部个数</th>
								<th width='20%'>有效时间</th>
								<th width='20%'>剩余时间</th>		
							</tr>
						</thead>
						<tbody id="inspect-tbody"></tbody>
					</table>
					<ul class="pagination" id="inspectList-pagination"></ul>
				</div>
			</div>
			<!-- ***********************************************巡审列表(按天审核)*************************************************** 
			<div class="tab-pane" id="inspectByDayList">
				<div class="panel panel-default">
					<div class="panel-body">
						<form class="form-inline" role="form">
							<div class="form-group">
								<div class="input-group">
									<div class="input-group-addon"> 审核时间：</div>
									<input class="form-control" id="datepicker" value="" type="text" readonly="readonly">
								</div>
							</div>
							<button type="button" id="resetTime" class="btn btn-default">清空</button>
							<button type="button" id="search2Btn" class="btn btn-default">查询</button>
							&nbsp;
							&nbsp;
							&nbsp;
							&nbsp;
							<div class="form-group">
								<p class="form-control-static">审核数量：</p>
							</div>
							<div class="form-group">
								<select class="form-control" id="inspectPercent_2">
									<option value="10">10%</option>
									<option value="20">20%</option>
									<option value="30">30%</option>
									<option value="40">40%</option>
									<option value="50">50%</option>
									<option value="60">60%</option>
									<option value="70">70%</option>
									<option value="80">80%</option>
									<option value="90">90%</option>
									<option value="100">100%</option>
								</select>
							</div>
						</form>
					</div>
					<table class="table table-striped table-bordered">
						<thead>
							<tr>
								<th width='10%'>序号</th>
								<th width='15%'>日期</th>
								<th width='15%'>任务数</th>
								<th width='20%'>状态</th>					
							</tr>
						</thead>
						<tbody id="inspectByDay-tbody"></tbody>
					</table>
					<ul class="pagination" id="inspectByDayList-pagination"></ul>
				</div>
			</div>-->
			<!-- ----------------------------------------------标注时间列表--------------------------------------------------- -->
			<div class="tab-pane" id="markTimeList">
				<div class="panel panel-default">
					<div class="panel-heading" style="height: 38px;">
						<span class="pull-right text-success" style="padding-left: 20px;"></span>
					</div>
					<div class="panel-body">
						<form class="form-inline" role="form">
							<div class="col-sm-3" style="width: 175px;">
								<div class="form-group">
									<div class="input-group" style="width: 170px;"> 
										<div class="input-group-addon">姓名:</div>
										<input class="form-control" onkeydown="if(event.keyCode==13){return false;}" id="realNameCondition" type="text" placeholder="查询姓名">
									</div>
								</div>							
							</div>	
							<div class="col-xs-2" style="width: 140px;">
								<div class="form-group">
									<div class="input-group" style="width: 135px;">
										<div class="input-group-addon">起始</div>
										<input class="form-control" onkeydown="if(event.keyCode==13){return false;}" id="markTimeListBeginDate" type="text" placeholder="起始时间">
									</div>
								</div>
							</div>					
							<div class="col-xs-2" style="width: 140px;">
								<div class="form-group">
									<div class="input-group" style="width: 135px;">
										<div class="input-group-addon">截止</div>
										<input class="form-control" onkeydown="if(event.keyCode==13){return false;}" id="markTimeListEndDate" type="text" placeholder="截止时间">
									</div>
								</div>
							</div>			
							<div class="col-xs-2" style="width: 101px;">
								<div class="form-group">
									<div class="input-group" style="width: 96px;">	
										<div class="input-group-addon">类别</div>
										<select class="form-control" id="markTimeListDateType">
											<option value="1">日</option>
											<option value="2" selected="selected">月</option>
											<option value="3">年</option>
										</select>
									</div>
								</div>
							</div>
							<div class="btn2" style="float: right;">
								<button type="button" id="markTimeListSearchBtn" class="btn btn-default" >查询</button>
							</div>			
						</form>
						<div style="clear: both;"></div>
					</div>
					<table class="table table-striped table-bordered">
						<thead>
							<tr>
								<th width='4%'>序号</th>
								<th width='12%'>姓名</th>
								<th width='15%'>标注时间(小时)</th>
								<th width='15%'>待审时间(小时)</th>
							</tr>
						</thead>
						<tbody id = "markTimeList-tbody"></tbody>
					</table>
					<ul class="pagination" id="markTimeList-pagination"></ul>
				</div>
			</div>
			<!-- -------------------------------------------不合格被退回列表---------------------------------------------------------- -->
			<div class="tab-pane" id="unqualifiedSendbackList">
				<div class="panel panel-default">
					<div class="panel-heading" style="height: 38px;">
						<span class="pull-right text-success" style="padding-left: 20px;"></span>
					</div>
					<div class="panel-body">
						<form class="form-inline" role="form">
							<div class="btn2" style="float: left;">
								<span style="color:green;">请注意，当可修改提交次数为1时，提交后再次被退回的任务会被系统直接回收！</span>
								<br>
								<span style="color:green;">超过时间未修改完毕的任务，也会被系统回收！</span>
							</div>	
							<div class="btn2" style="float: right;">
								<button type="button" id="sendbackListSearchBtn" class="btn btn-default" >查询</button>
							</div>			
						</form>
						<div style="clear: both;"></div>
					</div>
					<table class="table table-striped table-bordered">
						<thead>
							<tr>
								<th width='4%'>序号</th>
								<th width='12%'>任务数</th>
								<th width='15%'>退回原因</th>
								<th width='15%'>可修改提交次数</th>
								<th width='15%'>剩余时间</th>
							</tr>
						</thead>
						<tbody id = "unqualifiedSendbackList-tbody"></tbody>
					</table>
					<ul class="pagination" id="unqualifiedSendbackList-pagination"></ul>
				</div>
			</div>
			<!-- -------------------------------------------被系统回收任务信息列表---------------------------------------------------------- -->
			<div class="tab-pane" id="recycledBySystemList">
				<div class="panel panel-default">
					<div class="panel-heading" style="height: 38px;">
						<span class="pull-right text-success" style="padding-left: 20px;"></span>
					</div>
					<div class="panel-body">
						<form class="form-inline" role="form">
							<div class="btn2" style="float: left;">
								<span style="color:green;">本列表内容为  超过修改次数  没有通过审核被系统回收的任务信息列表  仅限查找错误问题使用</span>
							</div>	
							<div class="btn2" style="float: right;">
								<button type="button" id="recycledBySystemListSearchBtn" class="btn btn-default" >查询</button>
							</div>			
						</form>
						<div style="clear: both;"></div>
					</div>
					<table class="table table-striped table-bordered">
						<thead>
							<tr>
								<th width='5%'>序号</th>
								<th width='7%'>任务数</th>
								<th width='73%'>退回原因</th>
								<th width='15%'>下载被回收任务</th>
							</tr>
						</thead>
						<tbody id = "recycledBySystemList-tbody"></tbody>
					</table>
					<ul class="pagination" id="recycledBySystemList-pagination"></ul>
				</div>
			</div>
			<!-- -------------------------------------------超时为修改完成被回收任务信息列表---------------------------------------------------------- -->
			<div class="tab-pane" id="modifyTimeOutList">
				<div class="panel panel-default">
					<div class="panel-heading" style="height: 38px;">
						<span class="pull-right text-success" style="padding-left: 20px;"></span>
					</div>
					<div class="panel-body">
						<form class="form-inline" role="form">
							<div class="btn2" style="float: left;">
								<span style="color:green;">本列表内容为  超过修改时间  没有修改完毕被系统回收的任务信息列表 </span>
							</div>	
							<div class="btn2" style="float: right;">
								<button type="button" id="modifyTimeOutListSearchBtn" class="btn btn-default" >查询</button>
							</div>			
						</form>
						<div style="clear: both;"></div>
					</div>
					<table class="table table-striped table-bordered">
						<thead>
							<tr>
								<th width='5%'>序号</th>
								<th width='7%'>任务数</th>
								<th width='15%'>退回时间</th>
								<th width='15%'>修改时长(小时)</th>
							</tr>
						</thead>
						<tbody id = "modifyTimeOutList-tbody"></tbody>
					</table>
					<ul class="pagination" id="modifyTimeOutList-pagination"></ul>
				</div>
			</div>
			<!-- ----------------------------------------------文章列表--------------------------------------------------- -->
			<div class="tab-pane" id="articleList">
				<div class="panel panel-default">
					<div class="panel-heading" style="height: 38px;">	
						<!-- <span id="aduitingMarkTimeMonthTotle" class="pull-right text-success" style="padding-left: 20px;"></span>
						<span id="taskMarkTimeMonthTotle" class="pull-right text-success"></span> -->
					</div>
					<div class="panel-body">
						<form class="form-inline" role="form">			
							
							<div class="form-group">
								<div class="input-group" style="width: 300px;">
							    	<input class="form-control" onkeydown="if(event.keyCode==13){return false;}" id="articleTitle" type="text" placeholder="请输入要查询的文章标题">
							    	<span class="input-group-btn">
							    		<button type="button" id="searchForArticle" class="btn btn-default">查询</button>
							    	</span>
							    </div>
							</div>
							<div class="pull-right">
								<button type="button" id="articleOpenLogBtn" class="btn btn-info">浏览记录</button>
								<button type="button" id="checkUnreadMsgBtn" class="btn btn-default">查看回复 <span id="unreadMsgNumBadge" class="badge" style="background-color: #ce2323;font-weight: 100;"></span></button>
								<%	int x = 3; int y=2; 
									if(x<y){ //暂时用不上隐藏掉 %>
										<button type="button" id="ownedArticle" class="btn btn-warning">已发布文章</button>
										<button type="button" id="createArticle" class="btn btn-success">发表新文章</button>
								<%	} %>
							</div>
						</form>
						<div style="clear: both;"></div>
					</div>
					<table class="table table-striped table-bordered">
						<thead>
							<tr>
								<th colspan="6" style="text-align: left;">
									<span style="margin-left: 15px;">置顶&公告</span>
								</th>
							</tr>
							<tr>
								<th width='10%'>序号</th>
								<th width='50%'>标题</th>
								<th width='5%'>状态</th>
								<th width='10%'>作者</th>
								<th width='10%'>回复/浏览</th>
								<th width='15%'>发布时间</th>
							</tr>
						</thead>
						<tbody id = "articleTop-tbody">
						</tbody>
						<thead>
							<tr>
								<th colspan="6" style="text-align: left;">
									<span style="margin-left: 15px;">最新内容</span>
								</th>
							</tr>
						</thead>
						<tbody id = "articleList-tbody">
						</tbody>
					</table>
					<ul class="pagination"></ul>
				</div>
			</div>
				<!--------------------------------  标注规则更新提示信息-------------------------------------------------->
	<div id="showVoiceNoteNotice" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header" style="height: 50px;">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
				</div>
				<div class="modal-body" align="center" style="font-size: 18px;">
					<div>
						<span>标注说明有更新或新内容发布,请注意查看!</span>
						<br/>
						<a href="${contextPath}/security/voiceNote">点击查看</a>
						<br/>
						<br/>
						<span style="color:green; font-size: 14px;">如已了解更新内容可点击不再提示,本提示将会在下次内容更新之前不再弹出!</span>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" id="neverNotice" class="btn btn-success" >不再提示</button>
					<button type="button" id="noticeClose" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
		<!--------------------------------  通知公告提示信息-------------------------------------------------->
	<div id="showNotice" class="modal fade">
		<div class="modal-dialog" style="width: 60%;">
			<div class="modal-content">
				<div class="modal-header" style="height: 50px;">
					<span id="noticeTitle" style="font-size: 22px"></span>
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
				</div>
				<div class="modal-body" style="font-size: 18px;">
					<div>
						<div id="noticeContent"></div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" id="neverShow" class="btn btn-success" >不再提示</button>
					<button type="button" id="vtdNoticeClose" class="btn btn-default" data-dismiss="modal">关闭</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
		</div>
	</div>
	<script type="text/javascript">
		var voiceNoteNoticeFlag = ${voiceNoteNoticeFlag };
		var hasSendback ='${hasSendback}';
		var nowPage = 0;
		var timeMark = 0;
		var userNameCondition = "";
		var packBatchName = "";
		var pageTotal = 0;
		var dateCondition = "";
		
		var markTimeListDateType = 2;
		var markTimeListBeginDate = "";
		var markTimeListEndDate = "";
		var realNameCondition = "";
		
		var alertFlag = false;
		var searchTitle = "";
		$(document).ready(function(){
			if(hasSendback == "true"){
				alert("您有被退回的任务请及时处理;");
			}
			var date = new Date();
			var todayDate = $.datepicker.formatDate( "yy-mm-dd",new Date());
			markTimeListBeginDate = todayDate;
			markTimeListEndDate = todayDate;
			$("#markTimeListBeginDate,#markTimeListEndDate").val(todayDate);
			
			loadUserList(1);
			loadArticles(1);
			loadUnreadMsgNum();
			if(voiceNoteNoticeFlag==1){
				$("#showVoiceNoteNotice").modal('show');
			}
			/*--------------------------------------时间控件-------------------------------------------------------*/
			$("#datepicker").datepicker(); 
			$("#datepicker").datepicker('option', 'dateFormat','yy-mm-dd');//set dateFormat 
			$("#markTimeListBeginDate").datepicker({
				changeMonth:true,
				changeYear:true,
				numberOfMonths:1,
				setDate:todayDate,
				onClose: function( selectedDate ) {
					$( "#markTimeListEndDate" ).datepicker( "option", "minDate", selectedDate );
				}
			});
			$("#markTimeListEndDate").datepicker({
				changeMonth:true,
				changeYear:true,
				numberOfMonths:1,
				onClose: function( selectedDate ) {
					$( "#markTimeListBeginDate" ).datepicker( "option", "maxDate", selectedDate );
				}
			});
			/*--------------------------------------点击查询按钮-------------------------------------------------------*/
			$("#searchBtn").click(function(){
				timeMark = $("#timeMark").val();
				userNameCondition = $("#userNameCondition").val();
				if(userNameCondition.indexOf("'")>=0){
					alert("请正确输入姓名");
					return false;
				}
				packBatchName = $("#packBatch").val();
				alertFlag = true;
				loadUserList(1);
			});
			$("#search2Btn").click(function(){
				dateCondition = $("#datepicker").val();
				loadListByDay(1);
			});
			$("#markTimeListSearchBtn").click(function(){
				markTimeListDateType = $("#markTimeListDateType").val();
				markTimeListBeginDate = $("#markTimeListBeginDate").val();
				markTimeListEndDate = $("#markTimeListEndDate").val();
				realNameCondition = $("#realNameCondition").val();
				if(realNameCondition.indexOf("'")>=0){
					alert("请正确输入姓名");
					return false;
				}
				markTimeList(1);
			});
			$("#sendbackListSearchBtn").click(function(){
				querySendbackList();
			});
			$("#recycledBySystemListSearchBtn").click(function(){
				queryRecycledBySystemList(1);
			});
			$("#modifyTimeOutListSearchBtn").click(function(){
				queryModifyTimeOutList(1);
			});
			/*--------------------------------------时间重置按钮-------------------------------------------------------*/
			$("#resetTime").click(function(){
				$("#datepicker").val("");
			});
		});
		/*--------------------------------------加载页面-------------------------------------------------------*/
		loadUserList = function(pageNum){
			timeMark = 999;  //去掉初审的时间选择条件  20161223
			$.ajax({
				type:'POST',
				data:{"timeMark":timeMark,"page":pageNum,"userName":userNameCondition,"packBatchName":packBatchName},
				url:'${contextPath}/security/inspector',
				dataType:'json',
				success:function(data){
					if(packBatchName==""){
						$("#packBatchNumText").html("");
						$("#packBatchNumText").html("全部个数");
					}else{
						$("#packBatchNumText").html("");
						$("#packBatchNumText").html("当前批次包含个数");
					}
					$("#inspect-tbody").empty();
					if(data.list == ""){
						$("#inspect-tbody").empty();
						$("#inspect-tbody").append("<tr class='text-danger'><td colspan='6'>无内容</td></tr>");
					}else{
						pageTotal = data.totlePage;
						$.each(data.list,function(i,item){
							var status = "不可用";
							if(item.userStatus == "1")status = "可用";
							var overTimeHtml = "";
							if(item.inspTimeoutFlag){//如果已经超时直接显示超时
								overTimeHtml = "<span style='color:red'>已超时</span>";
							}else{
								overTimeHtml = "<span style='color:green' id = 'overTime_"+(i + 1)+"'></span>";
								intervalEveryOne = window.setInterval(
									function() {
										ShowCountDown(item.endMsec,$("#overTime_"+(i + 1)));
								}, 1000);
							}
							var tr = "";
							if(item.markTime==0){
								tr = "<tr title='此条有效时间为0，点击账号可直接审核通过~ 点击有效时间可以修改成有效任务!'>"+
									"<td>"+(i+1)+"</td>"+
									"<td><a style='color: green;' href='javascript:markTimeZero("+item.worker_id+",\""+item.upload_uuid+"\");'>"+item.user_name+"</a></td>"+
									"<td style='color: green;'>"+item.workerRealName+"</td>"+
									"<td style='color: green;'>"+item.c+"</td>"+
									"<td style='color: green;'><a style='color: green;' href='javascript:changeZeroTo0001("+item.worker_id+",\""+item.upload_uuid+"\");'>"+item.markTime+"</a></td>"+
									"<td >"+overTimeHtml+"</td>"+
								"</tr>";
							}else{
								tr = "<tr>"+
									"<td>"+(i+1)+"</td>"+
									"<td><a target='_blank' href='${contextPath}/security/inspectorList?workerId="+item.worker_id+"&uploadUUID="+item.upload_uuid+"' onclick='addPercentParam(this,1);'>"+item.user_name+"</a></td>"+
									"<td>"+item.workerRealName+"</td>"+
									"<td>"+item.c+"</td>"+
									"<td>"+item.markTime+"</td>"+
									"<td>"+overTimeHtml+"</td>"+
								"</tr>";
							}
							$("#inspect-tbody").append(tr);
							var pageDom = $(".pagination");
							pageDom.empty();
							page.creatPageHTML(pageNum,pageTotal,pageDom,"loadUserList");
							/*--------------------------------------跳转页-------------------------------------------------------*/
							$(".pageGoBtn").click(function(){
								var pageNum = 0;
								pageNum = $(".pageGoText").val();
								if(pageNum !=0&&0<pageNum&&pageNum<pageTotal+1){
									loadUserList(pageNum);
								}
							});
						});
					}
					if(data.notice!=""){//显示通知公告
						$("#noticeTitle").html(data.notice.noticeTitle);
						$("#noticeContent").html(data.notice.noticeContent);
						$("#showNotice").modal('show');
					}
					if(alertFlag){
						alert("查询完毕!");
					}
				}
			});
		};
		/*--------------------------------------巡审页面-------------------------------------------------------*/
		loadListByDay = function(pageNum){
			$.ajax({
				type:'POST',
				data:{"page":pageNum,"dateCondition":dateCondition},
				url:'${contextPath}/security/inspectorByDay',
				dataType:'json',
				success:function(data){
					$("#inspectByDay-tbody").empty();
					if(data.list == ""){
						$("#inspectByDay-tbody").empty();
						$("#inspectByDay-tbody").append("<tr class='text-danger'><td colspan='5'>无内容</td></tr>");
					}else{
						pageTotal = data.totlePage;
						$.each(data.list,function(i,item){
							var insTbody = "";
							var status = "";
							var aLink = "";
							if(item.status==1||item.status==4){
								status = "<span style='color:green'>已审核</span>";
								aLink="<td><a target='_blank' href='javascript:void(0);'>"+item.wrDate+"</a></td>";
							}else if(item.status==3){
								status = "<span style='color:red'>未审核</span>";
								aLink="<td><a target='_blank' href='${contextPath}/security/inspectorByDayList?insDate="+item.wrDate+"' onclick='addPercentParam(this,2);'>"+item.wrDate+"</a></td>";
							}
							insTbody ="<tr>"+
									"<td>"+(i+1)+"</td>";
							insTbody=insTbody+aLink;
							insTbody=insTbody+"<td>"+item.taskNum+"</td>"+
									"<td>"+status+"</td>"+
								"</tr>";
							$("#inspectByDay-tbody").append(insTbody);
							var pageDom = $("#inspectByDayList-pagination");
							pageDom.empty();
							page.creatPageHTML(pageNum,pageTotal,pageDom,"loadListByDay");
							/*--------------------------------------跳转页-------------------------------------------------------*/
							$(".pageGoBtn").click(function(){
								var pageNum = 0;
								pageNum = $(".pageGoText").val();
								if(pageNum !=0&&0<pageNum&&pageNum<pageTotal+1){
									loadListByDay(pageNum);
								}
							});
						});
					}
				}
			});
		};
		/*--------------------------------------公用方法-------------------------------------------------------*/
		addPercentParam = function(obj,idNo){ //处理链接地址键入百分比   idNo为页面两个select的id号
			var selectId = "inspectPercent_"+idNo;
			var showInvalidTask = $("#showInvalidTaskSelect").val();
			var href = obj.href.split("&percent")[0];//避免percent参数重复  链接截取掉percent之后的部分
			obj.href = href+"&percent="+$("#"+selectId).val()+"&showInvalidTask="+showInvalidTask;
			
		};
		/*******************************倒计时**************************************************/
		function ShowCountDown(endTime, obj) {
			var now = new Date();
			var leftTime = endTime - now.valueOf();
			var leftsecond = parseInt(leftTime / 1000);
			var day1 = Math.floor(leftsecond / (60 * 60 * 24));
			var hour = Math.floor((leftsecond - day1 * 24 * 60 * 60) / 3600);
			var minute = Math
					.floor((leftsecond - day1 * 24 * 60 * 60 - hour * 3600) / 60);
			var second = Math.floor(leftsecond - day1 * 24 * 60 * 60 - hour
					* 3600 - minute * 60);

			obj.text(day1 + "天" + hour + "小时" + minute + "分" + second + "秒");
		}
		/*--------------------------------------有效时间列表--------------------------------------------*/
		markTimeList = function(pageNum){
			$.ajax({
				type:'POST',
				data:{"page":pageNum,"dateType":markTimeListDateType,"beginDate":markTimeListBeginDate,"endDate":markTimeListEndDate,"nameCondition":realNameCondition},
				url:'${contextPath}/security/queryInspectorMarkTimeList', 
				dataType:'json',
				success:function(data){
					$("#markTimeList-tbody").empty();			
					if(data.list == ""){
						$("#markTimeList-tbody").empty();
						$("#markTimeList .pageGoBtn").empty();
						$("#markTimeList-tbody").append("<tr class='text-danger'><td colspan='4'>无内容</td></tr>");
					}else{
						var markTimeListPageTotal = data.totlePage; 
						$.each(data.list,function(i,item){
							$("#markTimeList-tbody").append(
							"<tr>"+
								"<td>"+(i + 1)+"</td>"+
								"<td>"+item.realName+"</td>"+
								"<td title='约"+item.sec+"秒'>"+item.markTimeHours  +"</td>"+
								"<td title='约"+item.aduiting+"秒'>"+item.aduitingHours  +"</td>"+
							"</tr>"
							);		
						});
						var pageDom = $("#markTimeList-pagination");
						pageDom.empty();
						page.creatPageHTML(pageNum,markTimeListPageTotal,pageDom,"markTimeList");
						/*--------------------------------------跳转页-------------------------------------------------------*/
						$("#markTimeList .pageGoBtn").click(function(){
							var pageNum = 0;
							pageNum = $("#markTimeList .pageGoText").val();
							if(pageNum !=0&&0<pageNum&&pageNum<markTimeListPageTotal+1){
								markTimeList(pageNum);
							}
						});			
					}
				}
			});
		};
		function markTimeZero(workerId,uploadUUID){
			var flag = confirm("该批次任务的有效时间为0，确定要审核通过吗？");
			if(flag){
				$.ajax({
					type : 'POST',
					data : {"workerId" : workerId, "uploadUUID" : uploadUUID},
					url : '${contextPath}/security/inspectionByWorkerMarkTimeIsZero',
					dataType : 'json',
					success : function(data) {
						alert(data.message); 
						loadUserList(1);
					}
				});
			}
		}
		
		function changeZeroTo0001(workerId,uploadUUID){
			var flag = confirm("该批次任务的有效时间为0 \r\n确定要修改该批次中每个任务的有效时间为0.001吗？");
			if(flag){
				$.ajax({
					type : 'POST',
					data : {"workerId" : workerId, "uploadUUID" : uploadUUID},
					url : '${contextPath}/security/updateWorkerRecordChangeZeroTo0001',
					dataType : 'json',
					success : function(data) {
						alert(data.message); 
						loadUserList(1);
					}
				});
			}
		}
		
		
		/*--------------------------------------被巡审退回列表--------------------------------------------*/
		querySendbackList = function(){
			$.ajax({
				type:'POST',
				url:'${contextPath}/security/querySendbackList', 
				dataType:'json',
				success:function(data){
					$("#unqualifiedSendbackList-tbody").empty();			
					if(data == ""){
						$("#unqualifiedSendbackList-tbody").empty();
						$("#unqualifiedSendbackList-tbody").append("<tr class='text-danger'><td colspan='5'>无内容</td></tr>");
					}else{
						$.each(data,function(i,item){
							var overTimeHtml = "";
							if(item.outsourcerFlag){
								if(item.timeoutFlag){//如果已经超时直接显示超时
									overTimeHtml = "<span style='color:red'>已超时</span>";
								}else{
									overTimeHtml = "<span style='color:green' id = 'sendbackOverTime_"+(i + 1)+"'></span>";
									intervalEveryOne_sendback = window.setInterval(
										function() {
											ShowCountDown(item.endMsec,$("#sendbackOverTime_"+(i + 1)));
									}, 1000);
								}
							}else{
								overTimeHtml = "<span style='color:red'>无限制</span>";
							}
							
							$("#unqualifiedSendbackList-tbody").append(
							"<tr>"+
								"<td>"+(i + 1)+"</td>"+
								"<td><a target='_blank' href='${contextPath}/security/sendbackInspectorList?sendbackUUID="+item.sendbackUUID+"&inspectorId="+item.inspectorId+"&inspectorRecordId="+item.inspectorRecordId+"' >"+item.num+"</a></td>"+
								"<td>"+item.reason+"</td>"+
								"<td>"+item.ableModifyCount+"</td>"+
								"<td>"+overTimeHtml+"</td>"+
							"</tr>"
							);		
						});
					}
				}
			});
		};
		
		/*--------------------------------------查询被系统回收列表--------------------------------------------*/
		queryRecycledBySystemList = function(pageNum){
			$.ajax({
				type:'POST',
				data:{"page":pageNum},
				url:'${contextPath}/security/queryRecycledBySystemList', 
				dataType:'json',
				success:function(data){
					$("#recycledBySystemList-tbody").empty();			
					if(data.list == ""){
						$("#recycledBySystemList-tbody").empty();
						$("#recycledBySystemList-tbody").append("<tr class='text-danger'><td colspan='4'>无内容</td></tr>");
					}else{
						var recycledBySystemListListPageTotal = data.totlePage; 
						$.each(data.list,function(i,item){
							$("#recycledBySystemList-tbody").append(
							"<tr>"+
								"<td>"+(i + 1)+"</td>"+
								"<td>"+item.num+"</td>"+
								"<td>"+item.reason+"</td>"+
								"<td><a href='/sendBackBackup/"+item.downloadPackName+"'>点击下载</a></td>"+
							"</tr>"
							);		
						});
						var pageDom = $("#recycledBySystemList-pagination");
						pageDom.empty();
						page.creatPageHTML(pageNum,recycledBySystemListListPageTotal,pageDom,"queryRecycledBySystemList");
						/*--------------------------------------跳转页-------------------------------------------------------*/
						$("#recycledBySystemList .pageGoBtn").click(function(){
							var pageNum = 0;
							pageNum = $("#recycledBySystemList .pageGoText").val();
							if(pageNum !=0&&0<pageNum&&pageNum<recycledBySystemListListPageTotal+1){
								queryRecycledBySystemList(pageNum);
							}
						});		
					}
				}
			});
		};
		/*--------------------------------------查询超时列表--------------------------------------------*/
		queryModifyTimeOutList = function(pageNum){
			$.ajax({
				type:'POST',
				data:{"page":pageNum},
				url:'${contextPath}/security/queryModifyTimeOutList', 
				dataType:'json',
				success:function(data){
					$("#modifyTimeOutList-tbody").empty();			
					if(data.list == ""){
						$("#modifyTimeOutList-tbody").empty();
						$("#modifyTimeOutList-tbody").append("<tr class='text-danger'><td colspan='4'>无内容</td></tr>");
					}else{
						var recycledBySystemListListPageTotal = data.totlePage; 
						$.each(data.list,function(i,item){
							$("#modifyTimeOutList-tbody").append(
							"<tr>"+
								"<td>"+(i + 1)+"</td>"+
								"<td>"+item.num+"</td>"+
								"<td>"+item.sendbackDateTime+"</td>"+
								"<td>"+item.sendbackLimitHour+"</td>"+
							"</tr>"
							);		
						});
						var pageDom = $("#modifyTimeOutList-pagination");
						pageDom.empty();
						page.creatPageHTML(pageNum,recycledBySystemListListPageTotal,pageDom,"queryModifyTimeOutList");
						/*--------------------------------------跳转页-------------------------------------------------------*/
						$("#modifyTimeOutList .pageGoBtn").click(function(){
							var pageNum = 0;
							pageNum = $("#modifyTimeOutList .pageGoText").val();
							if(pageNum !=0&&0<pageNum&&pageNum<recycledBySystemListListPageTotal+1){
								queryRecycledBySystemList(pageNum);
							}
						});		
					}
				}
			});
		};

		$("#neverNotice").click(function(){
			$.ajax({
				type : 'POST',
				url : '${contextPath}/security/voiceNoteNoticeNeverReceive',
				success : function(data) {
					if(data.replay==0){
						alert("更新出错请联系系统维护人员！");
					}
				}
			});
			$("#noticeClose").trigger("click");
		});
		$("#neverShow").click(function(){
			$.ajax({
				type : 'POST',
				url : '${contextPath}/security/noticeNeverReceive',
				success : function(data) {
					if(data.replay==0){
						alert("更新出错请联系系统维护人员！");
					}
				}
			});
			$("#vtdNoticeClose").trigger("click");
		});
		//---------------------------------交流区处理代码----------------------------------------------
		$("#createArticle").click(function(){
			window.open("${contextPath}/security/createArticle","_blank");
		});
		$("#ownedArticle").click(function(){
			window.open("${contextPath}/security/ownedArticleList","_blank");
		});
		
		$("#searchForArticle").click(function(){
			searchTitle = $("#articleTitle").val();
			loadArticles(1);
		});
		
		loadArticles = function(pageNum){
			$.ajax({
				type: 'POST',
				url: '${contextPath}/security/loadArticles',
				data: {"title": searchTitle, "page": pageNum, "createUsername":""},
				dataType: 'json',
				success: function (data) { 
					if(data.topArticleList == ""){
						$("#articleTop-tbody").empty();
						$("#articleTop-tbody").append("<tr class='text-danger'><td colspan='6'>无内容</td></tr>");
					}else{
						$("#articleTop-tbody").empty();
						$.each(data.topArticleList,function (i, item) {
							var isLockedTD_top = "";
							if(item.isLocked==1){
								isLockedTD_top = "<td><img title='该文章禁止评论' alt='该文章禁止评论' src='${contextPath}/images/folder_lock.gif'></td>" 
							}else{
								isLockedTD_top = "<td></td>" 
							}	
							$("#articleTop-tbody").append(
								"<tr>"+
									"<td>" + (i + 1) + "</td>" + 
									"<td class='titleTd'><a href='${contextPath}/security/showArticleContent?id=" + item.id + "' target='_blank'>" + item.articleTitle + "</a></td>" + 
									isLockedTD_top+ 
									"<td>" + item.createUsername + "</td>" + 
									"<td>"+item.commentNum+"/"+item.openLogNum+"</td>" + 
									"<td>" + item.createTime + "</td>" + 
								"</tr>"
							);
		
						});
					}
					if (data.list == "") {
						$("#articleList-tbody").empty();
						$("#articleList-tbody").append("<tr class='text-danger'><td colspan='6'>无内容</td></tr>");
						var pageDom = $("#articleList .pagination");
						pageDom.empty();
					} else {
						$("#articleList-tbody").empty();
						$.each(data.list,function (i, item) {
							var isLockedTD = "";
							if(item.isLocked==1){
								isLockedTD = "<td><img title='该文章禁止评论' alt='该文章禁止评论' src='${contextPath}/images/folder_lock.gif'></td>" 
							}else{
								isLockedTD = "<td></td>" 
							}
							$("#articleList-tbody").append(
								"<tr>"+
									"<td>" + (i + 1) + "</td>" + 
									"<td class='titleTd'><a href='${contextPath}/security/showArticleContent?id=" + item.id + "' target='_blank'>" + item.articleTitle + "</a></td>" + 
									isLockedTD+ 
									"<td>" + item.createUsername + "</td>" + 
									"<td>"+item.commentNum+"/"+item.openLogNum+"</td>" + 
									"<td>" + item.createTime + "</td>" + 
								"</tr>"
							);
		
						});
						var pageDom = $("#articleList .pagination");
						pageDom.empty();
						pucPageTotle = data.totlePage;
						page.creatPageHTML(pageNum, pucPageTotle, pageDom, "loadArticles");
						$("#articleList .pageGoBtn").click(function () {
							var pageNum = 0;
							pageNum = $("#articleList .pageGoText").val();
							if (pageNum != 0 && 0 < pageNum && pageNum < pucPageTotle + 1) {
								loadUnCompletePackList(pageNum);
							}
						});
					}
				}
			});
		};
		
		// 查询被回复的新消息个数    checkUnreadMsgBtn
		loadUnreadMsgNum = function(){
			$.ajax({
				type : 'POST',
				url : '${contextPath}/security/loadUnreadMsgNum',
				success : function(data) {
					$("#unreadMsgNumBadge").html(data.num);
				}
			});
		};
		
		$("#checkUnreadMsgBtn").click(function(){
			window.open("${contextPath}/security/jumpToUnreadMsgListPage","_blank");
		});
		
		$("#articleOpenLogBtn").click(function(){
			window.open("${contextPath}/security/jumpToArticleOpenLogListPage","_blank");
		});
	</script>
</body>
</html>
